--File ： ChapterView.lua
--Author : zee
--Date   : 2015/4/8
--Description : 关卡主界面 chapter.fla 第一帧




BMap = class("BMap",function()
    -- 继承
    local ret = cc.Node:create() 
    ret.group = nil
    ret.dx = 0
    ret.dy = 0

    ret.func = nil
    return ret
end)

BMap.__index = BMap


function BMap:create()
    local ret = BMap:new()
    ret:init()
    return ret
end





function BMap:init()
    self.ary_mapCub = SSArray:create()
    self:addMapCub(300)
end


function BMap:addMapCub(num)
    for i=1,num do 
        local bg = cc.Sprite:create( string.format("img/map_floor_%d.png",i%3+1 ))
        self:addChild(bg)
        bg:setAnchorPoint(cc.p(0,0))
        local hei = bg:getBoundingBox().height
        -- save:
        local count = self.ary_mapCub:getCount()
        self.ary_mapCub:add(bg)
        bg:setPosition( 0,hei*count )
    end
end



function BMap:onFrame(dt)
    local x,y = self:getPosition()
    self:setPosition(x, y-G_Map_Move_Speed)
    if( y<=-G_Map_Move_Limmit ) then
        self:MapAtEnd()
        return
    end
end


function BMap:updatePosition(y)
    
end


function BMap:MapAtEnd()

end




